﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.RazorDirectiveAttribute
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

using Microsoft.Internal.Web.Utils;

namespace System.Web.Razor
{
  /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents an attribute for the Razor directive.</summary>
  [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
  public sealed class RazorDirectiveAttribute : Attribute
  {
    private readonly object _typeId = new object();

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the <see cref="T:System.Web.Razor.RazorDirectiveAttribute" /> class.</summary>
    /// <param name="name">The name of the attribute.</param>
    /// <param name="value">The value of the attribute.</param>
    public RazorDirectiveAttribute(string name, string value)
    {
      this.Name = !string.IsNullOrEmpty(name) ? name : throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, nameof (name));
      this.Value = value;
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the unique type ID of the attribute.</summary>
    /// <returns>The unique type ID of the attribute.</returns>
    public override object TypeId => this._typeId;

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the attribute.</summary>
    /// <returns>The name of the attribute.</returns>
    public string Name { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the attribute.</summary>
    /// <returns>The value of the attribute.</returns>
    public string Value { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object.</summary>
    /// <returns>true if the object is equal to the this instance; otherwise, false.</returns>
    /// <param name="obj">The object to compare with this instance.</param>
    public override bool Equals(object obj) => obj is RazorDirectiveAttribute directiveAttribute && this.Name.Equals(directiveAttribute.Name, StringComparison.OrdinalIgnoreCase) && StringComparer.OrdinalIgnoreCase.Equals(this.Value, directiveAttribute.Value);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance.</summary>
    /// <returns>The hash code for this instance.</returns>
    public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(this.Name) * 31 + (this.Value == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(this.Value));
  }
}
